package com.joelaws.prototype.server.blackberry;

import org.restlet.Context;
import org.restlet.data.MediaType;
import org.restlet.data.Request;
import org.restlet.data.Response;
import org.restlet.resource.Representation;
import org.restlet.resource.Resource;
import org.restlet.resource.StringRepresentation;
import org.restlet.resource.Variant;


import com.joelaws.prototype.server.MeetingService;
import com.joelaws.prototype.server.dao.DAOFactory;

public class Reset extends Resource {

	public Reset(Context context, Request request, Response response) {
		super(context, request, response);

		super.getVariants().add(new Variant(MediaType.TEXT_PLAIN));
	}

	@Override
	public Representation getRepresentation(Variant variant) {
		Representation representation = new StringRepresentation(
				"Reset Complete", MediaType.TEXT_PLAIN);
		DAOFactory.reset();
		MeetingService.getService().reset();
		return representation;
	}

	public static String getURL() {
		return "/reset";
	}
}
